﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PessModel
{
    public static class Helper
    {
        public static string ToCountyCode(this string countyName,PESSEntities db)
        {
            //PESSEntities db = new PESSEntities();
            return db.Counties.Where(c => c.Name == countyName.Trim()).SingleOrDefault().Code;
        }
        public static int ToSubjectID(this string subjectName, int activityID, PESSEntities db)
        {
            return db.Subjects.Where(s => s.Name==subjectName&&s.ActivityID==activityID).SingleOrDefault().ID;
        }
    }
}
